package com.xuwei.base.generic;

import java.util.List;
import java.util.Arrays;

import org.junit.Test;

public class Demo3 {
	@Test
	public void test1(){
		String s1[]={"a","b","c"};
		GenericPractice.m1(s1, 1, 2);
		List<String> list=Arrays.asList(s1);
		System.out.println(list);
		
	}
	
	@Test
	public void test2(){
		String s1[]={"a","b","c"};
		GenericPractice.reverse(s1);
		List list=Arrays.asList(s1);
		System.out.println(list);
		
		Integer i1[]={1,2,4,5,9};
		GenericPractice.reverse(i1);//只有引用类型才能作为泛型方法的实际参数
		List list1=Arrays.asList(i1);
		System.out.println(list1);
		
		int i2[]={1,2,3};
		List list2=Arrays.asList(i2);
		System.out.print(list2);
		
		int[] _i2=(int[])list2.get(0);
		for(int i:_i2){
			System.out.println(i);
		}
		
	}
	

}
